/*!
    \copyright Copyright (c) 2025 Qualcomm Technologies International, Ltd.
    \version 
    \file 
    \addtogroup accessory_device_service
    \brief Creates tables of marshal type descriptors for Accessory device service data types
    @{
*/

#ifndef ACCESSORY_DEVICE_SERVICE_MARSHAL_DESC_H
#define ACCESSORY_DEVICE_SERVICE_MARSHAL_DESC_H

#if defined(INCLUDE_ACCESSORY_DEVICE_SERVICE) && defined(INCLUDE_MIRRORING)

#include "types.h"
#include "app/marshal/marshal_if.h"
#include "accessory_device_service_private.h"
#include <marshal_common.h>

#define NUMBER_OF_ACCESSORY_DEVICE_SERVICE_COMMON_MARSHAL_OBJECT_TYPES   (1)

/* Data structure to be marshalled/unmarshalled by accessory device service */
typedef struct
{
    /*! Type of accessory */
    uint8 type;

    /*! Current state of accessory */
    uint8 state;
} accessory_device_service_marshal_data_t;

#define ACCESSORY_DEVICE_SERVICE_MARSHAL_TYPES_TABLE(ENTRY) \
    ENTRY(accessory_device_service_marshal_data_t)

#define ACCESSORY_DEVICE_SERVICE_COMMON_MARSHAL_TYPES_TABLE(ENTRY) \
    ENTRY(uint8) 

/* Use xmacro to expand type table as enumeration of marshal types */
#define EXPAND_AS_ENUMERATION(type) MARSHAL_TYPE(type),
enum 
{
    /* common types must be placed at the start of the enum */
    DUMMY = NUMBER_OF_ACCESSORY_DEVICE_SERVICE_COMMON_MARSHAL_OBJECT_TYPES - 1,
    ACCESSORY_DEVICE_SERVICE_MARSHAL_TYPES_TABLE(EXPAND_AS_ENUMERATION)
    ACCESSORY_DEVICE_SERVICE_MARSHAL_OBJ_TYPE_COUNT
};
#undef EXPAND_AS_ENUMERATION

extern const marshal_type_descriptor_t * const  mtdesc_accessory_device_service[];

#endif /* defined(INCLUDE_ACCESSORY_DEVICE_SERVICE) && defined(INCLUDE_MIRRORING) */

#endif /* ACCESSORY_DEVICE_SERVICE_MARSHAL_DESC_H */

/*! @} */
